package com.lanxin.bean;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 权限 角色
 */
@Entity
@Table(name = "qx_role")
public class QxRole {

	@Id
	@GeneratedValue(strategy = IDENTITY)
  private Integer oid;
  private String roleName; // 角色名称
  private String description; // 角色描述
	//多对多
	@ManyToMany
	@JoinTable(name="qx_role_user",joinColumns = {@JoinColumn(name="roleid")},
			inverseJoinColumns = {@JoinColumn(name = "eid")})
	private Set<ZzEmployee> employees = new HashSet<>();

	//多对多
	@ManyToMany
	@JoinTable(name="Qx_Role_Function",joinColumns={@JoinColumn(name="roleid")},
			inverseJoinColumns={@JoinColumn(name="functionid")})
	private Set<QxFunction>  functions= new HashSet<QxFunction>();


  
		
	
  public Set<QxFunction> getFunctions() {
			return functions;
		}

		public void setFunctions(Set<QxFunction> functions) {
			this.functions = functions;
		}

	public Set<ZzEmployee> getEmployees() {
		return employees;
	}

	public void setEmployees(Set<ZzEmployee> employees) {
		this.employees = employees;
	}

	public Integer getOid() {
    return oid;
  }

  public void setOid(Integer oid) {
    this.oid = oid;
  }


  public String getRoleName() {
    return roleName;
  }

  public void setRoleName(String roleName) {
    this.roleName = roleName;
  }


  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

}
